package com.iss.view.room;

import com.iss.controller.RoomController;
import com.iss.model.Room;
import com.iss.view.Index;
import com.iss.view.view.Window;

import java.util.Scanner;

public class Info extends Window {

    public RoomController controller = new RoomController();
    public static Room CURRENT_ROOM=new Room();
    @Override
    public String print() {
        System.out.println("先建的房间信息是：");
        System.out.println("房间编号是："+Info.CURRENT_ROOM.getRoomNO());
        Scanner scanner = new Scanner(System.in);

        System.out.println("是否确认(y/n):");
        cmd= scanner.next();

        Boolean flag=  controller.add(Info.CURRENT_ROOM);
        if(flag){
            System.out.println("添加成功");


        }else{
            System.out.println("添加失败");
        }
        return cmd;
    }

    @Override
    public Window getNextWindow(String cmd) {

        if(cmd.equals("y")){
            return new Index();
        }
        return null;
    }


}
